package com.zheng.hr.rpc.api;

import com.alibaba.fastjson.JSONArray;
import com.zheng.common.base.BaseService;
import com.zheng.hr.dao.model.HrDict;
import com.zheng.oa.common.exception.OaException;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author likun
 * @since 2018-01-10
 */
public interface HrDictService extends BaseService<HrDict> {
    HrDict getDictByValue(String value, String key);

    HrDict getDictByName(String Name, String key);

    String getDictName(String value, String key, String defaultValue);

    List<String> getDictNames(String[] values, String key);

    String getDictValue(String name, String key, String defaultName);

    String getValue(String name, String key, String defaultValue);

    List<HrDict> getDictList(String key);

    //获取最大的排序
    int selectMaxSort();

    //创建dict（多个）
    boolean createDict(JSONArray dictArray) throws OaException;

    //修改dict（多个，先删除再重新创建）
    boolean updateDict(List<HrDict> dicts, String oldKey) throws OaException;

    int selectDictCount(String search);

    boolean deleteBatchDict(String ids) throws OaException;
}
